# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
# Contributor: Johannes Marbach <n0-0ne+gitlab@mailbox.org>
pkgname=py3-pytest-httpserver
pkgver=1.1.0
pkgrel=0
pkgdesc="Http server for pytest to test http clients"
url="https://github.com/csernazs/pytest-httpserver"
arch="noarch"
license="MIT"
depends="python3 py3-werkzeug"
makedepends="py3-gpep517 py3-installer py3-poetry-core"
checkdepends="py3-pytest py3-pytest-runner py3-requests py3-toml"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/csernazs/pytest-httpserver/archive/$pkgver.tar.gz"
builddir="$srcdir/pytest-httpserver-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages test-env
	test-env/bin/python3 -m installer .dist/pytest_httpserver-*.whl
	test-env/bin/python3 -m pytest \
		-k 'not test_ipv6' # Ever thought about gardening instead?
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/pytest_httpserver-*.whl
}

sha512sums="
cc69af1b58af0e823013945143532c0b116f2ab36bdc9b6f6ce2031b7285754e5aa56d1220e32ffb4a1b05e39becc1ac03b05007297e413fa2996c17b4323706  py3-pytest-httpserver-1.1.0.tar.gz
"
